package com.xoa.controller.party;


import com.xoa.model.party.EnAutoCompany;
import com.xoa.service.party.EnAutoCompanyService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *  汽修企业
 * Created by gsb on 2018/1/5.
 */
@Controller
@RequestMapping("/enAutoCompany")
public class EnAutoCompanyController {
    @Resource
    private EnAutoCompanyService enAutoCompanyService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-5 下午16:46:51
     * 类介绍  :   新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EnAutoCompany> insertSelective(EnAutoCompany enAutoCompany, HttpServletRequest request, String gridLocation){
        return enAutoCompanyService.insertSelective(enAutoCompany, request,gridLocation);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-5 下午16:48:51
     * 类介绍  :   删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EnAutoCompany> deleteByPrimaryKey(Integer cid){
        return enAutoCompanyService.deleteByPrimaryKey(cid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-5 下午16:48:51
     * 类介绍  :   修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EnAutoCompany> updateByPrimaryKeySelective(EnAutoCompany enAutoCompany, HttpServletRequest request, String gridLocation){
        return enAutoCompanyService.updateByPrimaryKeySelective(enAutoCompany, request,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-5 下午17:25:51
     * 类介绍  :   详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EnAutoCompany> selectById(Integer cid){
        return enAutoCompanyService.selectById(cid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-5 下午17:25:51
     * 类介绍  :   列表  或 导出 也可条件查询
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EnAutoCompany> queryList(EnAutoCompany enAutoCompany, Integer page, Integer pageSize,
                                           boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return enAutoCompanyService.queryList(enAutoCompany, page, pageSize, useFlag, request, response, export);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-5 下午16:25:51
     * 类介绍  :   导入
     * 构造参数:
     *
     */
    @RequestMapping(value ="importEnAutoCompany")
    @ResponseBody
    public ToJson<EnAutoCompany> importEnAutoCompany(MultipartFile file, HttpServletResponse response,
                                                     HttpServletRequest request, HttpSession session) {
        return enAutoCompanyService.importEnAutoCompany(file, response, request, session);
    }
}
